<?php
set_time_limit(0);
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
include '../c/config.php';

$dbZong='121.41.208.81';
$mysqliZong = new mysqli($dbZong, $dbuser, $dbpwd, $dbName);
if (!$mysqliZong->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliZong->error);}

$dbhostA='121.41.216.144';
$mysqli = new mysqli($dbhostA, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqli->error);}
$query=$mysqli->query("SELECT * FROM `uf`  ");
while ($list=$query->fetch_assoc()){
    $sid='b'.$list['id'];
    $queryZong=$mysqliZong->query("SELECT * FROM `z_uf` where sid='".$sid."' limit 0,1 ");
    if($queryZong->num_rows>0){
        
    }else{
        $mysqliZong->query("INSERT INTO `z_uf` (`sid`,`openid`,`name`,`school`,`phone`,`idcard`,`createtime`) 
VALUES ('".$sid."','".$list['openid']."', '".$list['name']."','".$list['school']."','".$list['phone']."','".$list['idcard']."','".$list['createtime']."')");
    }
}
echo 'done2';